<template>
    <div class="video">
        <!-- 倒计时 -->
        <div class="timeOut">
            <p class="dowmMoney">请下注</p>
            <p class="timeShow">{{time}}</p>
        </div>
        <!-- 广播 -->
        <div class="RedioBox"><p>DV娱乐厅~DV娱乐厅~DV娱乐厅~DV娱乐厅~DV娱乐厅~DV娱乐厅~</p></div>
            <!-- 视频 -->
            <canvas class="videos" id="videoOne" width="500px" height="350px" ></canvas>
            <div class="loginDV" v-show="init.Room.videoBox.one"></div>
            <span v-show="init.Room.videoBox.one">加载中...</span>
    </div>
</template>
<script>
export default {
    name:"leftVideo", 
    data(){
        return {
            time:60,
                // 初始化数据
            init: {
                personal: {
                    name: "DDD1号",
                    money: 12000
                },
                Room: {
                    nember: "百家乐A1",
                    gameNum: "GCS15200",
                    gameRedTop: "20-6000",
                    personalRedTop: "500",
                    personalDownMoney: 0,
                    onLine: 988,
                    z: 0,
                    h: 0,
                    he: 0,
                    z2: 0,
                    h2: 0,
                    videoBox: {
                        one: true,
                        two: true
                    },
                    Player: {},
                    sonRooom: {
                        "迪威一厅": [
                            { id: 1, time: 30 },
                            { id: 2, time: 45 },
                            { id: 3, time: 25 },
                            { id: 4, time: 18 },
                            { id: 5, time: 50 },
                            { id: 6, time: 30 },
                            { id: 7, time: 30 },
                            { id: 8, time: 30 },
                            { id: 9, time: 12 },
                            { id: 10, time: 50 },
                            { id: 11, time: 55 },
                            { id: 12, time: 60 },
                            { id: 13, time: 9 },
                            { id: 14, time: 12 },
                            { id: 15, time: 17 },
                            { id: 16, time: 60 },
                            { id: 17, time: 5 },
                            { id: 18, time: 19 },
                            { id: 19, time: 48 },
                            { id: 20, time: 30 },
                            { id: 21, time: 30 },
                            { id: 22, time: 60 },
                            { id: 23, time: 52 },
                            { id: 24, time: 48 },
                            { id: 25, time: 37 },
                            { id: 26, time: 34 },
                            { id: 27, time: 46 },
                            { id: 28, time: 50 },
                            { id: 29, time: 52 },
                            { id: 30, time: 51 },
                        ],
                        "迪威二厅": [
                            { id: 1, time: 30 },
                            { id: 2, time: 45 },
                            { id: 3, time: 25 },
                            { id: 4, time: 18 },
                            { id: 5, time: 50 },
                            { id: 6, time: 30 },
                            { id: 7, time: 30 },
                            { id: 8, time: 30 },
                            { id: 9, time: 12 },
                        ]
                    }
                }
            },
        }
    },
    mounted(){
              // 倒数定时器
          var _this = this;     
         setInterval(function () {
            var i;
            _this.time--;
            if (_this.time < 0) {
                _this.time = 60;
            }
            else if (_this.time < 54) {
                _this.cardResult = "";
            }
            _this.star = true;
            for (i in _this.init.Room.sonRooom) {
                _this.init.Room.sonRooom[i].forEach(function (state) {
                    if (state.time == 0) {
                        state.time = 60;
                    }
                    else {
                        state.time--;
                    }
                });
            }
        }, 1000);
    }
}
</script>

